package cn.gyouzhe.component.disruptor;

import com.alibaba.fastjson.JSON;
import com.lmax.disruptor.ExceptionHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * 默认异常
 *
 * @author wangchuan
 * @createTime 2018/2/8 20:12
 */
@Slf4j
public class DisruptorDefaultException implements ExceptionHandler<Event> {
    @Override
    public void handleEventException(Throwable ex, long sequence, Event event) {
        log.error("触发处理器异常" + JSON.toJSONString(event.getData()), ex);
    }

    @Override
    public void handleOnStartException(Throwable ex) {
        log.error("处理器启动异常", ex);
    }

    @Override
    public void handleOnShutdownException(Throwable ex) {
        log.error("处理器启动异常", ex);
    }
}
